package loadbean;

import loadbean.autoload.Klass;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Create by chenhd on 2021/9/4.
 */
public class LoadTest {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        //使用xml配置
        Student student = context.getBean(Student.class);
        System.out.println(student.getName());

        //使用注解自动配置
        Klass klass = context.getBean(Klass.class);
        System.out.println(klass.getName());


    }

}
